import request from '@/utils/request'

// 查询重车作业单申报管理列表
export function listSwBdHead(query) {
  return request({
    url: '/swdecl/swBdHead/list',
    method: 'get',
    params: query
  })
}

// 查询重车作业单申报管理详细
export function getSwBdHead(id) {
  return request({
    url: '/swdecl/swBdHead/getInfo/' + id,
    method: 'get'
  })
}

//编辑详情
export function getEditSwBdHead(id) {
  return request({
    url: '/swdecl/swBdHead/getEditInfo/' + id,
    method: 'get'
  })
}


// 新增重车作业单申报管理
export function addSwBdHead(data) {
  return request({
    url: '/swdecl/swBdHead/add',
    method: 'post',
    data: data
  })
}

// 修改重车作业单申报管理
export function updateSwBdHead(data) {
  return request({
    url: '/swdecl/swBdHead/edit',
    method: 'post',
    data: data
  })
}

// 删除重车作业单申报管理
export function delSwBdHead(id) {
  return request({
    url: '/swdecl/swBdHead/remove/' + id,
    method: 'get'
  })
}

export function genGbill(id) {
  return request({
    url: '/swdecl/swBdHead/genGbill/' + id,
    method: 'get'
  })
}


// 申报
export function declSwBdHead(id) {
  return request({
    url: '/swdecl/swBdHead/addDecl/' + id,
    method: 'get'
  })
}

export function modifyDeclSwBdHead(data) {
  return request({
    url: '/swdecl/swBdHead/modifyDecl',
    method: 'post',
    data: data
  })
}

// 重发
export function declRepeatSwBdHead(id) {
  return request({
    url: '/swdecl/swBdHead/declRepeat/' + id,
    method: 'get'
  })
}


//退单
export function chargebackSwBdHead(id) {
  return request({
    url: '/swdecl/swBdHead/revokeDecl/' + id,
    method: 'post',
  })
}
